<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    public function machine(){
        return $this->belongsTo(Commodity::class);
    }

    public function user(){
        return $this->belongsTo(User::class);
    }

    public function orderGood(){
        return $this->hasMany(OrderGood::class,'order_id','id');
    }

    public function getStatusAttribute($value){
        return config('conf.order_status')[$value];
    }
}
